Journal Entry POST

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/accounting-service/journal-entry/

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

Create a new Journal in your Brightpearl accounting system. Journals can be created one at a time and the POST message will respond with the ID assigned to the newly created Journal

Journal Entry POST Validation

Validation of Journal POST input is performed in two stages against both header and line fields. First header and line validation rules applicable to ALL journal types are applied and then Journal Type specific rules are evaluated against header and lines.

Common Header Validation Rules

a) Journal Type Code

Cannot be missing or empty.

b) Journal Date

Cannot be missing or empty, must be a valid date in the default date format of the account (e.g. yyy-mm-dd), and must exist in an open accounting period.

c) Nominal Code

Cannot be missing or empty, must exist in the Chart of Accounts and must be an active nominal account.

d) Currency Id

Cannot be missing or empty and must exist in the account's list of currencies. If the currency is a non base currency (foreign currency), then the account must have the Brightpearl Multi Currency option enabled or else the journal will be rejected and only base currency journals maybe posted.

e) Exchange Rate

Exchange Rate is an optional field governed by the following rules:
1) If the Currency Id of the journal is the account's base currency, then the rate must equal 1.000000.
2) If the Currency Id of the journal is NOT the account's base currency and an Exchange Rate value is supplied, this value will be used to derive base currency equivalents for the journal transaction values.
Exchange Rate values must be expressed as positive numbers not exceeding six decimal places.

f) Bank Account Nominal Codes and Tax Code

If a line contains a Bank Nominal Code then a Tax Code for the line must be present and must be any Tax Code other than Tax Code 1.

Common Line Validation Rules

There is no indicator in the payload indicating whether a line is a debit or credit. The end point determines this state, by the presence of either a transactionCredit or transactionDebit field in the payload for a line. If both transactionCredit and transactionDebit fields are supplied at the line level a validation error will occur.

a) Transaction Debit and Transaction Credit Values

Journal lines must contain either a transactionDebit or transactionCredit value. The value of the element must be number greater or equal to zero and must be expressed to a maximum of two decimal places.

b) Balanced Transaction Values

The difference between the sum of transactionDebit lines and the sum of transactionCredit lines must equal zero. If the transaction amounts do not balance (i.e. the difference of the sums is not zero), a validation error will occur.

c) Sales Tax and Purchase Tax Nominals in the same Journal

You may not specify a Sales Tax and Purchase Tax nominal code within the same journal

d) Accounts Receivable (1100) and Accounts Payable (2100) Nominals.

You may not specify an Accounts Receivable (1100) and Accounts Payable (2100) nominal in the same Journal.

Journal Type Specific Validations

1) JJ Journals

Example

Request URI

/journal-entry/

Request body

{
	"header": {
		"journalType": "JJ",
		"journalDate": "2015-07-27",
		"dateDue": "2015-07-27",
		"description": "A description",
		"currencyId": 1,
		"exchangeRate": 1.000000,
		"contactId": 23
	},
	"lines": [
		{
			"transactionDebit": 1100.00,
			"nominalCode": "1200",
			"taxClassId": "1",
			"invoiceRef": "a reference",
			"orderId": 5,
			"projectId": 6,
			"channelId": 7,
			"leadSourceId": 8
		},
		{
			"transactionCredit": 550.00,
			"nominalCode": "4000",
			"taxClassId": "1",
			"invoiceRef": "a reference",
			"orderId": 5,
			"projectId": 6,
			"channelId": 7,
			"leadSourceId": 8
		},
		{
			"transactionCredit": 550.00,
			"nominalCode": "4000",
			"taxClassId": "1",
			"invoiceRef": "a reference",
			"orderId": 5,
			"projectId": 6,
			"channelId": 7,
			"leadSourceId": 8
		}
	]
}

Response

{
	"response": 20
}